package com.xs.designs.duty_chain.config;

import com.xs.designs.duty_chain.chain.IHandler;
import com.xs.designs.duty_chain.chain.ProductChainFactory;
import com.xs.designs.duty_chain.pojo.ProductDto;
import com.xs.designs.duty_chain.temp.ProductChainSpringFactory;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

import java.util.List;

@Configuration
public class MyConfig {
    @Bean
    public ProductChainSpringFactory productChainSpringFactory(List<IHandler<ProductDto,Boolean>> handlerList){
        return new ProductChainSpringFactory(handlerList);
    }
    @Bean
    public ProductChainSpringFactory xushuproductChainSpringFactory(List<IHandler<Object,Boolean>> handlerList){
        return new ProductChainSpringFactory(handlerList);
    }


    @Bean
    public ProductChainFactory productChainFactory(List<IHandler> handlerList){
        return new ProductChainFactory(handlerList);
    }
}
